package cn.com.yang.thread;

import java.util.concurrent.locks.ReentrantLock;

/**
 * 
 * @author 杨亿金
 * @date 2022年9月2日-上午8:55:36
 * @since 1.0.0
 */
public class TestReetrantLock {
	public static ReentrantLock reentrantLock = new ReentrantLock();
	
	public static void main(String[] args) {
		new Thread(()-> {
			reentrantLock.lock();
			try {
				System.out.println(Thread.currentThread().getName()+"do some things");
			} catch (Exception e) {
				reentrantLock.unlock();
			}
		}).start();
	}
}
